<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="./../../html/res/css/style.css" />
<link href="./../../html/res/css/table.css" rel="stylesheet" type="text/css">
<link href="./../../html/res/css/user.css" rel="stylesheet" type="text/css">
<link href="./../../html/res/css/pager.css" rel="stylesheet" type="text/css">

<title>WBD 网络小说下载</title>
<meta name="description" content="网络小说下载">
<meta name="keyword" content="网络小说下载工具">
<script type="text/javascript" src="./../../html/res/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="./../../html/res/js/jquery.pager.js"></script>
<script type="text/javascript" src="./../../html/res/js/util.js"></script>

</head>
<body>
<div id="topbj">
<!-- $headnav$ -->
<div id="zhuce">
	<div class="zcelist"><b class="bzce">[var.out.page_title;htmlconv=no]</b></div>
    <div id="div_errormsg" class="zcelist0 hide"><b class="bzce"><span id="errormsg" style="color:#f00;"></span></b></div>
   
    <div id="userDetailGridDiv">
        <table id="resultTable" style="border:1px solid #FFF;width:100%;">
        <thead>
            <tr class="trbg">
                <th style="width:60px"><center>序号</center></th>
                <th style="width:160px"><center>姓名</center></th>
                <th ><center>性别</center></th>
                <th ><center>年龄</center></th>
                <th ><center>职业</center></th>
                <th ><center>力量</center></th>
                <th ><center>敏捷</center></th>
                <th style=""><center>体质</center></th>
                <th style=""><center>精神</center></th>
                <th style=""><center>智力</center></th>
                <!-- <th style="width:100px"><center>ud9</center></th> -->
                <th style="width:150px"><center>创建时间</center></th>
                <th style="width:150px"><center>更新时间</center></th>
            </tr>
        </thead>
        <tbody>
        </tbody>
        </table>
        <div id="pager"></div>
        
    </div>
    <div style="clear:both;padding:15px;color:#000;text-align: left;"></div>
   

</div>

<!-- $foot$ -->

<div class='hide'>
<textarea id='column_title_def' class='hide'>[var.out.column_title_def; htmlconv=no]</textarea>
<textarea id='column_type_def' class='hide'>[var.out.column_type_def; htmlconv=no]</textarea>
</div>

<script type="text/javascript" src="./../../html/res/app.js?v=[var.out.js_css_ver;noerr]"></script>
<script type="text/javascript">
'use strict';
var column_title_def=null;
var column_type_def=null;
var url = 'api2016.php?ajax=1&c=member&a=site_list&d='+new Date().getTime();
$(document).ready(function(){

	column_title_def=$('#column_title_def').text();
	column_type_def=$('#column_type_def').text();
	column_title_def=column_title_def.replace(/`, `/gm,';');
	column_title_def=column_title_def.replace(/`/gm,'');

	column_type_def=column_type_def.replace(/`, `/gm,';');

	column_title_def=column_title_def.split(';');
	column_type_def=column_type_def.split(';');
	var _html = '';
	if(column_title_def!=null){
		_html +='<tr style="height:20px" class=row>';
        for(var i=0;i<column_title_def.length;i++){
			var col_tmp = column_title_def[i];
            _html+='<td>'+col_tmp+'</td>';
        }
        _html +='</tr>'
        
    }
	$('#resultTable thead').html(_html);

    var pager = $('#pager').pager({
        limit:15,
        buttonClickCallback:function(start,pager){
            loadPage(start,pager);
        }
    });
    loadPage(0,pager);
    
});

function loadPage(start,pager){
    $.getJSON(url+'&start='+start+'&limit='+pager.limit+'&d='+new Date().getTime(),function(result){
        // $('#resultTable tr[class=row]').remove();
        $('#resultTable tbody').html('');
        if(result.return_code==0){
            var _html = '';

            if(result.data!=null){
                for(var i=0;i<result.data.length;i++){
                    var r = result.data[i];

                    _html +='<tr style="height:20px" class="row">';
                    
                    for(var ii=0;ii<column_title_def.length;ii++){
						var col_tmp = column_title_def[ii];
						if(col_tmp=='name'){
							var tt=gen_a_link(r.id,r.name);
						}else{
							var tt1 = getAtt(r,col_tmp);
							var tt = fix_display(tt1);
						}
						
			            _html+='<td>'+tt+'</td>';
			        }

                    _html +='</tr>';
                    $('#resultTable tbody').append(_html);
                    _html='';
                    
                }
                
            }
            // $('#resultTable').append(_html);
            pager.setPageData({
                start:start,
                total:result.count
            });
        } else {
            var msg = '<font style="color:red">加载数据失败:</font>'+result.data;
            pager.setPageData({displayMsg:msg});
        }
    });
}

function fix_display(str){
	if(!str) return str;
	var re = new RegExp("<", "g");
	str  = str.replace(re, "&lt;");

	re = new RegExp(">", "g");
	str  = str.replace(re, "&gt;");

	// var s=str.replace(/</gm,'&lt;');
	// s=s.replace(/>/gm,'&gt;');
	return str;
}

function gen_a_link(code,title){
    var isDebugMode='[var.out.debugMode; htmlconv=no]';
    var d='';
    if(+isDebugMode>0) d='&debug=1';    
    return '<a href="index.php?ks=1&c=site&a=details'+d+'&id='+code+'" target="_blank">'+title+'</a>';
}

function cell_fix (v,isTime) {
    if(v){
        if(isTime){
            return v.replace(' ','&nbsp;');
        }else{
            return v;
        }
        
    } else{
        return '&nbsp;';
    }
}

</script>
</body>
</html>
